import { HttpUrlVariable } from '@/constants'
import type { PatientAdd, PatientEdit, PatientItem, PatientLook } from '@/types/archive'
import RequestHttp from '@/utils/request'

export const getPatientListAPI = () =>
  RequestHttp.get<PatientItem[]>(HttpUrlVariable.PATIENT_LIST_URL)

//删除患者
export const delPatientItemAPI = (id: string) =>
  RequestHttp.delete<string>(HttpUrlVariable.DEL_PATIENT_ITEM_URL + id)

//添加患者
export const addPatientItemAPI = (data: PatientAdd) =>
  RequestHttp.post<string>(HttpUrlVariable.ADD_PATIENT_ITEM_URL, data)

//患者详情
export const lookPatientItemAPI = (id: string) =>
  RequestHttp.get<PatientLook>(HttpUrlVariable.LOOK_PATIENT_ITEM_URL + id)

//编辑患者
export const editPatientItemAPI=(data:PatientEdit)=>
  RequestHttp.put<null>(HttpUrlVariable.EDIT_PATIENT_ITEM_URL,data)